<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Trim</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>Trim <span class="ver">[AHK_L 31+]</span></h1>

<p>Trims characters from the beginning and/or end of a string.</p>

<pre class="Syntax">Result :=  Trim(String, OmitChars = " `t")
Result := LTrim(String, OmitChars = " `t")
Result := RTrim(String, OmitChars = " `t")</pre>
<h3>Parameters</h3>
<dl>

  <dt>String</dt>
  <dd><p>Any string value or variable.  Numbers are not supported.</p></dd>

  <dt>OmitChars</dt>
  <dd><p>An optional list of characters (case sensitive) to exclude from the beginning and/or end of <em>String</em>.  If omitted, spaces and tabs will be removed.</p></dd>

</dl>

<h3>Examples</h3>
<pre class="NoIndent">text := "  text  "
MsgBox % "No trim:`t '" text "'"
    . "`nTrim:`t '" Trim(text) "'"
    . "`nLTrim:`t '" LTrim(text) "'"
    . "`nRTrim:`t '" RTrim(text) "'"
MsgBox % LTrim("00000123","0")</pre>

</body>
</html>
